//
//  DQBCustomAlertVIew.h
//  DrivingQuestionBank
//
//  Created by mac on 2024/1/10.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
    AlertViewTypeDefault, // 默认样式 (title，subTitle，确认，取消...)
    AlertViewTypeSignalTitle, // 只有标题
    AlertViewTypeSignalSubTitle, // 只有子标题
    AlertViewTypePicAndStatus, // tip 图片
} AlertViewType;

typedef enum : NSUInteger {
    AlertActionTypeDefault, // 默认样式
} AlertActionType;


typedef void(^ActionBlock)(NSString * _Nonnull titleStr);
@interface DQBCustomAlertAction : NSObject

+ (instancetype _Nullable )initActionWithTitle:(nullable NSString *)title
                               AlertActionType:(AlertActionType)actionType
                                   BlockAction:(void(^_Nullable)(NSString * _Nonnull titleStr))blockAction;

@property (nullable, nonatomic, readonly) NSString *actionTitle;
@property (nonatomic, readonly) AlertActionType actionType;
@property (nonatomic, copy) ActionBlock _Nullable actionBlock;

@end

@interface DQBCustomAlertVIew : UIView

@property (nonatomic, assign) AlertViewType alertViewType;

@property (nonatomic, readonly) NSArray<DQBCustomAlertAction *> *actions;



- (instancetype)initWithTitle:(nullable NSString *)titleStr
                      leftStr:(nullable NSString *)leftStr
                      rightStr:(nullable NSString *)rightStr
                   alertImage:(nullable UIImage *)alertImage;

//在window上弹框
- (void)show;

// 弹框消失处理
- (void)disMiss;

- (void)addAction:(DQBCustomAlertAction *)action;

@end

NS_ASSUME_NONNULL_END
